#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include<QLabel>
#include"RegisterWidget.h"
#include"HomeWidget.h"
#include"GetBack.h"
QT_BEGIN_NAMESPACE
namespace Ui { class LoginWidget; }
QT_END_NAMESPACE

class LoginWidget : public QLabel
{
    Q_OBJECT

public:
    LoginWidget(QWidget *parent = nullptr);
    ~LoginWidget();
    void keyPressEvent(QKeyEvent *ev) override;
    bool eventFilter(QObject *obj,QEvent* ev) override;
    void CheckInputs();
    void SetStyleInit();
private:
   void paintEvent(QPaintEvent *event) override;
   bool checkPwdValid();
   void initHttpHandlers();
private slots:
    void on_AgreementPushButton_clicked();

    void on_HidePushButton_clicked();

    void on_LoginPushButton_clicked();

    void on_RegisterPushButton_clicked();

    void on_RetrievePushButton_clicked();

    void slot_login_mod_finish(ReqId id , QString res ,ErrorCode err);

    void handle_token_expired(); // 新增 Token 过期处理;

signals:


private:
    Ui::LoginWidget *ui;
    QMap<ReqId,std::function<void(const QJsonObject&)>> _handles;
};
#endif // LOGINWIDGET_H
